package com.base.study.presenter;

import android.app.Activity;

import com.base.commonlib.base.presenter.BasePresenter;
import com.base.commonlib.http.RealNetWorkUtil;
import com.base.commonlib.http.utils.CallBackImpl;
import com.base.study.bean.EsSearchResultBean;
import com.base.study.bean.SearchResultBean;
import com.base.study.view.ESSearchDetailView;
import com.base.study.view.PopualSearchView;

import java.util.HashMap;
import java.util.List;

import io.reactivex.disposables.Disposable;

/**
 * Created by weikailiang on 2020/3/4.
 */

public class ESSearchDetailPresenter extends BasePresenter<ESSearchDetailView>{
    public ESSearchDetailPresenter(ESSearchDetailView view, Activity activity) {
        super(view, activity);
    }


    public void getData(String id){
        HashMap<String, Object> params = new HashMap<>();
        params.put("flfgId", "1");
        //初始化控件
        Disposable disposable = RealNetWorkUtil.get()
                .params(params)
                .method("api-legal/legal/getOriginalfile")
                .build().enqueue(EsSearchResultBean.class, new CallBackImpl<EsSearchResultBean>() {
                    @Override
                    public void onError(int code, String msg, String errMsg) {
                        mView.showError();
//                        mView.returnError();

                    }
                    @Override
                    public void onNext(EsSearchResultBean data) {
                        mView.returnData(data);

                    }
                });
        mCompositeDisposable.add(disposable);
    }
}
